var useNat = false;
var IP = "localhost";
var porta = 25000;

function Awake() {
	Application.runInBackground = true;
	
}



function OnGUI ()
{
	GUILayout.Space(10);

	
	GUILayout.BeginHorizontal();
	GUILayout.Space(10);
	if (Network.peerType == NetworkPeerType.Disconnected){
		GUILayout.BeginVertical();
		if (GUILayout.Button ("Connect"))
		{
			Network.Connect(IP,porta);
		}
		if (GUILayout.Button ("Start Server"))
		{
			Network.InitializeServer(25,porta, useNat);
		}
		GUILayout.EndVertical();
		
		IP = GUILayout.TextField(IP,25);
		porta = parseInt(GUILayout.TextField(porta.ToString(),25));

	}
	else{
		Application.LoadLevel (1);
	}
	
	GUILayout.FlexibleSpace();
	GUILayout.EndHorizontal();
}


function connect(){

}